package com.bosssoft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bosssoft.entity.po.FibExpenseBudgetPO;
import java.util.List;

import com.bosssoft.model.SubjectExpenseModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author Li kexi
 * Created on 2021/8/23.10:58
 */
@Mapper
public interface FibExpenseBudgetMapper extends BaseMapper<FibExpenseBudgetPO> {
    int updateBatch(List<FibExpenseBudgetPO> list);

    int updateBatchSelective(List<FibExpenseBudgetPO> list);

    int batchInsert(@Param("list") List<FibExpenseBudgetPO> list);

    int insertOrUpdate(FibExpenseBudgetPO record);

    int insertOrUpdateSelective(FibExpenseBudgetPO record);

    @Select("select * from fib_expense_budget \n" +
            "where  dept_id=#{childrenId} and status=#{status}")
    List<FibExpenseBudgetPO> getExpenseBudgetByDeptId(Long childrenId, Integer status);

    @Select("select dept_id,eco_code,amount from fib_expense_budget \n" +
            "where status=#{status} and `year`=#{year}"  )
    List<SubjectExpenseModel> selectByStatus(Integer status, Integer year);
}